const express = require('express')
// 创建路由对象
const router = express.Router()

// 导入用户路由处理函数模块
const poetryHandler = require('../../router_handler/poetry')

// 读取JOSN文件
router.get('/out/getPoetryConfig', poetryHandler.getPoetryConfig)

// 获取诗歌信息
router.post('/out/poetry/getPoetry', poetryHandler.getPoetry)

// 添加诗歌
router.post('/poetry/addPoetry', poetryHandler.addPoetry)

// 根据id删除诗歌信息
router.post('/poetry/deletePoetryById', poetryHandler.deletePoetryById)

// 根据诗歌名称/诗句/朝代/诗人查找诗歌信息
router.post('/out/poetry/searchPoetryByNameOrVerseDynastyOrAuthor', poetryHandler.searchPoetryByNameOrVerseDynastyOrAuthor)

// 根据id修改诗歌信息
router.post('/poetry/updatePoetryById', poetryHandler.updatePoetryById)

// 根据id获取诗歌信息
router.get('/out/poetry/getPoetryByPid', poetryHandler.getPoetryByPid)

// 根据标签获取诗歌信息
router.get('/out/poetry/getPoetryByLid', poetryHandler.getPoetryByLid)

// 收藏诗歌
router.post('/poetry/collectPoetry', poetryHandler.collectPoetry)

// 查询收藏信息
router.get('/poetry/queryCollectPoetryInfo', poetryHandler.queryCollectPoetryInfo)

// 将路由对象共享出去
module.exports = router
